
var result="" ;
var language ="";
var company = "";
var workyear = "";
// 事件冒泡
document.querySelector(".select").onclick= function (event){

    var ele = event.target;

    ele = ele.parentElement; //<dd>
    if(ele.nodeName ==='DD'){
        //其他元素 删除样式
       var childrenEle =  ele.parentElement.children;
       for(var i =0;i<childrenEle.length;i++){
           childrenEle[i].classList.remove("selected");
       }
       // 当前元素 添加样式
        ele.classList.add("selected");
       // URL 拼接

       if(ele.parentElement.firstElementChild.innerText ==='语言方向'){
                language = ele.innerText;
          }else if(ele.parentElement.firstElementChild.innerText ==='公司'){
                 company=ele.innerText;
       }else if(ele.parentElement.firstElementChild.innerText ==='工作年限'){
               workyear =ele.innerText;
       }


       result = "language="+language+"&company="+company+"&workyear="+workyear;
       //language=Javacompany=外企workyear=1-3年
        //language=Java&company=外企&workyear=1-3年
        //language=Java&company=外企&minworkyear=1&maxworkyear=3

        console.log("result:" + result);
    }



}
function funSelAll(){
    var selects=document.querySelector(".selOne");
    if(document.getElementsByClassName("selAll").checked===true) {
        for (var i = 0; i < selects.length; i++) {
            selects[i].checked = false;
        }
    }
}


